home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: news.sprintlink.net!mv!usenet
- From: ENGR@GSSI.MV.COM (Michael Furman)
- Subject: Re: Help me please
- Message-ID: <DoL71M.32H@mv.mv.com>
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- Organization: GSSI
- Date: Wed, 20 Mar 1996 22:12:58 GMT
- References: <9MGBMHAUirSxEwbi@waichung.demon.co.uk>
- X-Newsreader: WinVN 0.99.7
- X-Nntp-Posting-Host: gssi.mv.com
-
- In article <9MGBMHAUirSxEwbi@waichung.demon.co.uk>, kyn@waichung.demon.co.uk
- says...
- >
- >I require help in constructing a binary search tree in c++, as i am
- >relatively new to the language i am not sure how to go about
- >implementing it.
- > Do i construct a class called btree or do i use the following:-
- >
- > struct node
- > {
- > data d;
- > struct node *left;
- > struct node *right;
- > }
-
- You just constructed class "node"! "struct" and "class" keywords in C++ are
- almost the same: "struct" is an equivalent of the class with "public:"
- placed before the first member.
-
- You can translate your pascal code, but it will be "C" - not C++ (but you can
- use C++ compiler because C is "almost" a subset of C++).
-
- If you want to use C++ features - first look for member functions and static
- member functions. Also for inheritance, if you want use your tree
- functionality for any data objects.
-
- --
- <<< If you received it by E-mail: it is a copy of post to the newsgroup >>>
- ---------------------------------------------------------------
- Michael Furman, (603)893-1109
- Geophysical Survey Systems, Inc. fax:(603)889-3984
- 13 Klein Drive - P.O. Box 97 engr@gssi.mv.com
- North Salem, NH 03073-0097 71543.1334@compuserve.com
- ---------------------------------------------------------------
-
-